//
//  MVPlayerCell.m
//  Coco_Music
//
//  Created by dlios on 15-6-25.
//  Copyright (c) 2015年 寇广超. All rights reserved.
//

#import "MVPlayerCell.h"

@implementation MVPlayerCell
-(void)dealloc
{
    [_mv release];
    [_titleLabel release];
    [_NameLabel release];
    [_PickLabel release];
    [_StepLabel release];
    [super dealloc];
    
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}
-(void)createSubViews
{
    self.myImageView =[[UIImageView alloc]initWithFrame:CGRectMake(5, 5, [UIScreen mainScreen].bounds.size.width/3, [UIScreen mainScreen].bounds.size.width/4)];
    self.myImageView.layer.masksToBounds = YES;
    self.myImageView.layer.cornerRadius = 5;
    
    [self addSubview:self.myImageView];
   
    
    [_myImageView release];
    
    self.titleLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.myImageView.frame.origin.x+self.myImageView.frame.size.width+20, self.myImageView.frame.origin.y, 200, 40)];
    [self addSubview:self.titleLabel];
    [_titleLabel release];
    
    self.NameLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.titleLabel.frame.origin.x,self.titleLabel.frame.size.height+self.titleLabel.frame.origin.y, 200, 30)];
    self.NameLabel.alpha = 0.7;
    [self addSubview:self.NameLabel];
    [_NameLabel release];
    
    self.PickLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.NameLabel.frame.origin.x,self.NameLabel.frame.size.height+self.NameLabel.frame.size.height, 120, 30)];
    self.PickLabel.alpha = 0.7;
    
    [self addSubview:self.PickLabel];
    [_PickLabel release];
    
    self.StepLabel =[[UILabel alloc]initWithFrame:CGRectMake(250, 90, 80, 30)];
    [self addSubview:self.StepLabel];
    [_StepLabel release];
    
    
    
    
    
}
-(void)setMv:(MV *)mv
{
    if (_mv != mv) {
        [_mv release];
        _mv = [mv retain];
    }
    self.titleLabel.text = mv.videoName;
    self.NameLabel.text = mv.SingerName;
    self.PickLabel.text =[NSString stringWithFormat:@"点击量:%ld",mv.pickCount];
//    self.StepLabel.text = [NSString stringWithFormat:@"赞:%ld",mv.stepCount];
    
    NSURL *url =[NSURL URLWithString:mv.bigPicUrl];
    [self.myImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"cm2_default_artist_banner-1"]];
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
